﻿<!DOCTYPE html>
<html>
  <head>
    <title>通用订单提前终止&amp;到期结算&amp;押金结算逻辑</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <link href="resources/css/jquery-ui-themes.css" type="text/css" rel="stylesheet"/>
    <link href="resources/css/axure_rp_page.css" type="text/css" rel="stylesheet"/>
    <link href="data/styles.css" type="text/css" rel="stylesheet"/>
    <link href="files/通用订单提前终止_到期结算_押金结算逻辑/styles.css" type="text/css" rel="stylesheet"/>
    <script src="resources/scripts/jquery-1.7.1.min.js"></script>
    <script src="resources/scripts/jquery-ui-1.8.10.custom.min.js"></script>
    <script src="resources/scripts/prototypePre.js"></script>
    <script src="data/document.js"></script>
    <script src="resources/scripts/prototypePost.js"></script>
    <script src="files/通用订单提前终止_到期结算_押金结算逻辑/data.js"></script>
    <script type="text/javascript">
      $axure.utils.getTransparentGifPath = function() { return 'resources/images/transparent.gif'; };
      $axure.utils.getOtherPath = function() { return 'resources/Other.html'; };
      $axure.utils.getReloadPath = function() { return 'resources/reload.html'; };
    </script>
  </head>
  <body>
    <div id="base" class="">

      <!-- Unnamed (矩形) -->
      <div id="u26000" class="ax_default _文本段落">
        <div id="u26000_div" class=""></div>
        <div id="u26000_text" class="text ">
          <p><span style="color:#FF0099;">提前终止周期服务订单的流程及算法</span></p><p><span><br></span></p><p><span>一、选择订单终止时间</span></p><p><span><br></span></p><p><span>二、判断当前用户有无已出的未支付或者部分支付的账单（必须是该订单下的账单），如果有，则自动生成n条扣款</span></p><p><span>（n）未付账单扣款——账单编号</span></p><p><span><br></span></p><p><span>三、这次提前终止有没有需要退的押金物品，退的东西坏没坏，要不要给他退钱</span></p><p><span><br></span></p><p><span>四、根据第三步的选择结果，如果有需要扣钱的，自动生成n条扣款信息</span></p><p><span>（n）押金物品遗失——押金物品名称：把弄坏的押金物品给赔偿了</span></p><p><span><br></span></p><p><span>五、如果还有啥需要扣钱的，可以手动创建n条扣款信息</span></p><p><span>（n）其他-填写的扣款内容</span></p><p><span><br></span></p><p><span>六、根据二四五加起来，得出应扣款金额（通过后这里会生成一条收入记录），用扣款前的该订单全部押金 - 应扣款的金额 = 扣款后押金</span></p><p><span><br></span></p><p><span>七、自动生成一条类型为【押金退款】的退款记录，&nbsp; 退款金额 =&nbsp; 扣款后押金&nbsp; </span></p><p><span><br></span></p><p><span>（1）押金退款-提前终止周期性服务订单退押金</span></p><p><span><br></span></p><p><span>八、判断下，如果原订单在未开始服务期内有对账完成的账单，则：</span></p><p><span><br></span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; 1、如果本次终止是我方原因：</span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 则自动生成自动生成一条类型为【已支付账单退款】的退款记录对应的退款信息：</span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; （n）已支付账单退款-提前终止周期服务退已支付账单</span></p><p><span><br></span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp;&nbsp; 2、如果是客户方原因：</span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 则去系统配置里检查下，当提前终止周期服务时，如果是客户方原因，退不退已支付账单</span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 2-1&nbsp; 如果退， 则自动生成一条类型为【已支付账单退款】的退款记录：</span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; （n）已支付账单退款-提前终止周期服务退已支付账单</span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 2-2 如果不退，则不生成这个类型的退款记录</span></p><p><span><br></span></p><p><span>九、申请通过，中止老订单，结束时间为表单提交的终止日</span></p><p><span><br></span></p><p><span><br></span></p><p><span><br></span></p><p><span>十、根据第七条产生的【押金退款】退款记录的金额，来进行不同处理：</span></p><p><span>（1）如果这条退款金额大于0，那么</span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A、生成一条【待打款】的退款申请，类型为【押金退款】</span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; B、同时将原押金单变更为【已失效】</span></p><p><span><br></span></p><p><span>（2）如果这条退款金额等于0，那么</span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; A、不生成退款申请，仅同时将原押金单变更为【已失效】</span></p><p><span><br></span></p><p><span>十一、根据第八条产生的【已支付账单退款】退款记录的金额，到底退不退，来进行不同处理：</span></p><p><span><br></span></p><p><span>&nbsp; 1、如果退：</span></p><p><span><br></span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; 生成一条【待打款】的退款申请，类型为【已支付账单退款】</span></p><p><span><br></span></p><p><span>&nbsp; 2、如果不退：</span></p><p><span><br></span></p><p><span>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 生成一条类型为【违约扣款-提前终止】【提前终止周期服务违约金】【提前终止服务内容对应的已支付账单不做退还】的收入。</span></p><p><span><br></span></p><p><span>十二、根据第六条产生的应扣款金额，生成一条的其他收入记录，内容包括：</span></p><p><span>（n）未付账单扣款——账单编号</span></p><p><span>&nbsp;&nbsp; 把对应的每条账单自动转为对账完成</span></p><p><span><br></span></p><p><span>（n）押金物品遗失——押金物品名称</span></p><p><span>（n）其他-填写的扣款内容</span></p><p><span><br></span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26001" class="ax_default box_2">
        <div id="u26001_div" class=""></div>
        <div id="u26001_text" class="text ">
          <p><span>订单终止结算</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26002" class="ax_default box_2">
        <div id="u26002_div" class=""></div>
        <div id="u26002_text" class="text ">
          <p><span>你需要给我多少钱</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26003" class="ax_default box_2">
        <div id="u26003_div" class=""></div>
        <div id="u26003_text" class="text ">
          <p><span>我需要给你退多少钱</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26004" class="ax_default box_2">
        <div id="u26004_div" class=""></div>
        <div id="u26004_text" class="text ">
          <p><span>你欠我的账单怎么算，我要从押金里扣</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26005" class="ax_default box_2">
        <div id="u26005_div" class=""></div>
        <div id="u26005_text" class="text ">
          <p><span>你弄坏我的押金物品怎么算</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26006" class="ax_default box_2">
        <div id="u26006_div" class=""></div>
        <div id="u26006_text" class="text ">
          <p><span>你这事违约了你知道吗？你要给钱</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26007" class="ax_default box_2">
        <div id="u26007_div" class=""></div>
        <div id="u26007_text" class="text ">
          <p><span>你还干了啥需要给我钱</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26008" class="ax_default box_2">
        <div id="u26008_div" class=""></div>
        <div id="u26008_text" class="text ">
          <p><span>你多给我预交的账单我给你退多少</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26009" class="ax_default box_2">
        <div id="u26009_div" class=""></div>
        <div id="u26009_text" class="text ">
          <p><span>你放在这里的押金我还能给你退多少</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26010" class="ax_default box_2">
        <div id="u26010_div" class=""></div>
        <div id="u26010_text" class="text ">
          <p><span>预存款账户</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26011" class="ax_default box_2">
        <div id="u26011_div" class=""></div>
        <div id="u26011_text" class="text ">
          <p><span>押金账户</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26012" class="ax_default box_2">
        <div id="u26012_div" class=""></div>
        <div id="u26012_text" class="text ">
          <p><span>押金账户</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26013" class="ax_default box_2">
        <div id="u26013_div" class=""></div>
        <div id="u26013_text" class="text ">
          <p><span>押金账户</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26014" class="ax_default box_2">
        <div id="u26014_div" class=""></div>
        <div id="u26014_text" class="text ">
          <p><span>押金账户</span></p>
        </div>
      </div>

      <!-- Unnamed (矩形) -->
      <div id="u26015" class="ax_default box_2">
        <div id="u26015_div" class=""></div>
        <div id="u26015_text" class="text ">
          <p><span>押金账户</span></p>
        </div>
      </div>

      <!-- Unnamed (连接线) -->
      <div id="u26016" class="ax_default _连接线">
        <img id="u26016_seg0" class="img " src="images/通用订单提前终止_到期结算_押金结算逻辑/u26016_seg0.png" alt="u26016_seg0"/>
        <img id="u26016_seg1" class="img " src="images/通用订单提前终止_到期结算_押金结算逻辑/u26016_seg1.png" alt="u26016_seg1"/>
        <div id="u26016_text" class="text " style="display:none; visibility: hidden">
          <p></p>
        </div>
      </div>

      <!-- Unnamed (连接线) -->
      <div id="u26017" class="ax_default _连接线">
        <img id="u26017_seg0" class="img " src="images/通用订单提前终止_到期结算_押金结算逻辑/u26017_seg0.png" alt="u26017_seg0"/>
        <img id="u26017_seg1" class="img " src="images/通用订单提前终止_到期结算_押金结算逻辑/u26016_seg1.png" alt="u26017_seg1"/>
        <div id="u26017_text" class="text " style="display:none; visibility: hidden">
          <p></p>
        </div>
      </div>
    </div>
  </body>
</html>
